export const checkType=(row)=>{
    if(row === null||row === undefined){
        return 'other'
    }
        let fileName;  
        if (typeof row === 'object') {  
            if (row.fileName) {  
                fileName = row.fileName;  
            } else if (row.file && row.file.name) {  
                fileName = row.file.name;  
            } else {  
                return 'other'; 
            }  
        } else if (typeof row === 'string') {  
            fileName = row;  
        } else {  
            return 'other'; 
        }  
        const imageRegex = /\.(jpg|bmp|jpeg|png|gif)$/i;  
        const videoRegex = /\.(mp4|mov|avi|flv|qt)$/i;  
          
        if (imageRegex.test(fileName)) {  
            return 'image';  
        } else if (videoRegex.test(fileName)) {  
            return 'video';  
        } else {  
            return 'other';  
        }  
    }
export const getFileName = (row) =>{
    if(row.file!==null){
        return row.file.name
    }
    else{
        return row.fileName
    }
}